//
//  SyneminAddContactVC.m
//  ContactOf0825
//
//  Created by 韩震明 on 15/11/23.
//  Copyright © 2015年 韩震明. All rights reserved.
//

#import "SyneminAddContactVC.h"
#import "SyneminCoreDataManager.h"
#import "SyneminLTView.h"

#import <Masonry.h>

@interface SyneminAddContactVC ()

@end

@implementation SyneminAddContactVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStylePlain target:self action:@selector(click:)];
    
    
    SyneminLTView *nameLT = [[SyneminLTView alloc] init];
    [self.view addSubview:nameLT];
    nameLT.myLabel.text = @"姓名";
    nameLT.myTextField.placeholder = @"输入姓名";
    [nameLT makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.greaterThanOrEqualTo(self.view).with.offset(64);
        make.top.lessThanOrEqualTo(self.view).with.offset(150);
        make.left.equalTo(self.view).with.offset(10);
        make.right.equalTo(self.view).with.offset(- 10);
        
    }];
    
    SyneminLTView *sexLT = [[SyneminLTView alloc] init];
    [self.view addSubview:sexLT];
    sexLT.myLabel.text = @"性别";
    sexLT.myTextField.placeholder = @"输出性别";
    [sexLT makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(nameLT.bottom).with.offset(10);
        make.left.equalTo(self.view).with.offset(10);
        make.right.equalTo(self.view).with.offset(- 10);
        make.height.equalTo(nameLT);
        
    }];
    
    SyneminLTView *numberLT = [[SyneminLTView alloc] init];
    [self.view addSubview:numberLT];
    numberLT.myLabel.text = @"学号";
    numberLT.myTextField.placeholder = @"输入学号";
    [numberLT makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(sexLT.bottom).with.offset(10);
        make.left.equalTo(self.view).with.offset(10);
        make.right.equalTo(self.view).with.offset(-10);
        make.height.equalTo(sexLT);
        
    }];
    
    SyneminLTView *phoneNumberLT = [[SyneminLTView alloc] init];
    [self.view addSubview:phoneNumberLT];
    phoneNumberLT.myLabel.text = @"电话号码";
    phoneNumberLT.myTextField.placeholder = @"输入电话号码";
    [phoneNumberLT makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(numberLT.bottom).with.offset(10);
        make.left.equalTo(self.view).with.offset(10);
        make.right.equalTo(self.view).with.offset(-10);
        make.height.equalTo(numberLT);
        
    }];
    
    SyneminLTView *qqLT = [[SyneminLTView alloc] init];
    [self.view addSubview:qqLT];
    qqLT.myLabel.text = @"QQ号码";
    qqLT.myTextField.placeholder = @"输入qq号码";
    [qqLT makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(phoneNumberLT.bottom).with.offset(10);
        make.left.equalTo(self.view).with.offset(10);
        make.right.equalTo(self.view).with.offset(-10);
        make.height.equalTo(phoneNumberLT);
    }];
    
    SyneminLTView *nativeLT = [[SyneminLTView alloc] init];
    [self.view addSubview:nativeLT];
    nativeLT.myLabel.text = @"籍贯";
    nativeLT.myTextField.placeholder = @"输入籍贯所在地";
    [nativeLT makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(qqLT.bottom).with.offset(10);
        make.left.equalTo(self.view).with.offset(10);
        make.right.equalTo(self.view).with.offset(-10);
        make.height.equalTo(qqLT);
        make.bottom.lessThanOrEqualTo(self.view).with.offset(-40);
        make.bottom.greaterThanOrEqualTo(self.view).with.offset(-300);
    }];
    
    
}
- (void)click:(UIBarButtonItem *)button
{
    
//    [[SyneminCoreDataManager defaults] updateFromSelectFormatString: arguments:];
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
